Add generic_page_range() -- generic page table operation.
authorakw27@arcadians.cl.cam.ac.uk <akw27@arcadians.cl.cam.ac.uk>
Mon, 15 Aug 2005 13:16:04 +0000 (13:16 +0000)
committerakw27@arcadians.cl.cam.ac.uk <akw27@arcadians.cl.cam.ac.uk>
Mon, 15 Aug 2005 13:16:04 +0000 (13:16 +0000)
commit235dd60ff035a9d53c201af3af8461e6399cc671
treef6b59f9c028e1cf07d5ac846e99eaa4f758127ce
parent47eb3d255aefd21be6d6b251707dd8f6499c6d07
Add generic_page_range() -- generic page table operation.

Linux has several instances of repeated code to do updates to a range
of PTEs.  Mapping memory between domains in Xen also tends to need to
do this quite frequently, to ensure page tables have been constructed
and to look up PTE addresses when making mapping-related hypercalls.
This patch adds a generic PTE walk-and-fill operation that takes a
function pointer to call on leaf entries.  direct_remap_area_pages()
is updated to use the new call, ass are abuses of
__direct_remap_area_pages.

This patch also introduces two new helper functions for working with
page tables when mapping memory between domains:
create_lookup_pte_addr() returns the machine address of a PTE,
allocating intermediate page tables as necessary.  touch_pte_range()
ensures that page tables exist for a virtual address range.

Many of the existing linux page table operations (e.g. zap/remap/etc)
could be modified to use this interface, which would potentially
shorten up mm/memory.c a bit.
linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c
linux-2.6-xen-sparse/arch/xen/x86_64/mm/ioremap.c
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
linux-2.6-xen-sparse/include/linux/mm.h
linux-2.6-xen-sparse/mm/memory.c